App.controller('salaryEmpBasicController', ['$rootScope', '$scope', '$state', 'Page', function($rootScope, $scope, $state, Page) {

    $scope.grid = {
        add : function() {
            $scope.salaryEmpBasic = {};
            $scope.modal.show();
        },
        update: function(row) {
            $scope.salaryEmpBasic = row;
           $scope.modal.show();
        },
        save : function() {
            Page.ajaxPost($scope.salaryEmpBasic.empId ? 'salaryEmpBasic/update.do' : 'salaryEmpBasic/add.do', $scope.salaryEmpBasic, function() {
                $scope.grid.query();
                $scope.grid.cancel();
            });
        },
        viewEmpQuota : function(row) {
        	$scope.salaryEmpBasic = row;
        	var empId = $scope.salaryEmpBasic.empId;
        	$scope.empQuotaArray = $scope.salaryEmpBasic.empQuotaArray;
        	$scope.empQuotaModal.show();
            /*Page.ajaxPost('salaryPayRoll/add.do', $scope.salaryPayRoll, function() {
                $scope.grid.query();
                $scope.grid.cancel();
            });*/
        },
        column_defs: [{
            target : 7,
            buttons : [
                {
                    name: '编辑',
                    class: 'btn-warning btm-sm',
                    icon: 'fa-edit',
                    event: 'update'
                }
                ,
                {
                    name: '工序定额',
                    class: 'btn-warning btm-sm',
                    icon: 'fa-edit',
                    event: 'viewEmpQuota'
                }
            ]
        }]
    };


}]);